/*
 * author      : 吴中勤 
 * date        : 2018/11/10
 * description : TODO
 */

package org.wzq.learn;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class ConfigClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigClientApplication.class, args);
    }

    // 从公共配置中获取
    @Value("${author}")
    private String author;

    // 从 applicationName-profile中获取
    @Value("${trade-name}")
    private String tradeName;

    @RequestMapping(value = "/hi")
    public String hi() {
        return "author=" + author + ", tradeName=" + tradeName;
    }
}